#include "stdafx.h"
#include "TGRxRx.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

BOOL TGGlobalInit()
{
	if (TGRxGlobal::m_pGlobal != NULL)
		return TRUE;

	TGRxGlobal::m_pGlobal = new TGRxGlobal;
	if (TGRxGlobal::m_pGlobal == NULL)
		return FALSE;

	if (!TGRxGlobal::m_pGlobal->Init())
	{
		delete TGRxGlobal::m_pGlobal;
		TGRxGlobal::m_pGlobal = NULL;
		return FALSE;
	}

	return TRUE;
}

BOOL TGGlobalRelease()
{
	if (TGRxGlobal::m_pGlobal == NULL)
		return TRUE;

	TGRxGlobal::m_pGlobal->Release();

	delete TGRxGlobal::m_pGlobal;
	TGRxGlobal::m_pGlobal = NULL;

	return TRUE;
}
